package com.example.mapper.emp;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.emp.SysPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface SysPermissionMapper extends BaseMapper<SysPermission> {
    
    /**
     * 获取权限树形列表
     */
    List<SysPermission> selectPermissionTree();
    
    /**
     * 获取角色的权限ID列表
     */
    List<Long> selectPermissionIdsByRoleId(@Param("roleId") Long roleId);
    
    /**
     * 获取用户的权限列表
     */
    List<SysPermission> selectPermissionsByUserId(@Param("userId") Long userId);
    
    /**
     * 检查权限是否有子权限
     */
    Integer hasChildren(@Param("permissionId") Long permissionId);
} 